Repository navigation
A Bot can read a large attached file to its end - #2876
Open
davidmckayv wants to merge 2 commits into
Open
davidmckayv wants to merge 2 commits into
davidmckayv wants to merge 2 commits into
Conversation
davidmckayv
force-pushed
the
read-whole-attachments
branch
from
December 3, 2026 16:25
4142ad3 to
f27ee31
Compare
davidmckayv
marked this pull request as ready for review
December 3, 2026 17:01
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 3, 2026 17:02
A large text file reached a Bot as its first 120,000 characters, with no way to read the rest, and the composer warned the file "may be cut". The server now offers every Bot a read_attachment tool that reads an attached file page by page. This has its name, how the conversation draws it, and the warning. - shared: the tool's name (read-attachment.ts), and its step words: "Reading an attached file" / "Read an attached file". - The conversation draws a run of reads of one file as one row naming the file and how many parts, and the folded line counts it as one file read. - API: deployment gains an optional attachmentsReadWhole. Where a server says true, the composer drops the "may be cut" warning, since the Bot reads the whole file. Absent, as from an older server, the warning stays as it was.
Found in the end-to-end run: a Bot that read only the end of a file made one read, drawn on a line of its own, and the line said "Read an attached file" with a wrench and no file. It now names the file the answer carries and draws a file, as the folded row does.
davidmckayv
force-pushed
the
read-whole-attachments
branch
from
December 3, 2026 17:38
5601f84 to
5cebb73
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
A large text file reached a Bot as its first 120,000 characters, with no way to read the rest. A customer's 267 to 500 KB text files reached their connected Bot cut off, and the composer warned "may be cut". The server now offers every Bot a
read_attachmenttool, over plain AG-UItools, that reads an attached file of the conversation page by page. This PR has the tool's name, how the conversation draws it, and the composer's warning:shared/read-attachment.ts) and its step words, "Reading an attached file" / "Read an attached file".deploymentgains an optionalattachmentsReadWhole(additive response field; absent means false). The app shows the feature only when the server says so.attachmentsReadWhole: true, a large text file's tile drops " · may be cut", because the Bot reads the whole file. Against an older server the warning stays exactly as it was. The tile's design doesn't change; the size line just loses the suffix.API checklist (docs/api-and-migrations.md): read; nothing removed, renamed or tightened; the new field is optional in an answer;
bun run api:generaterun and committed with sources, bundle and clients;oasdiff breakingagainst main reports no breaking changes;bun run api:lintclean.Red/green
app/tests/composer-attachments-ui.test.tsx, "does not warn on a large text file when the server's Bots read the whole file": red with the composer's!readsWhole &&taken out (Received: "notes.txt117KB · may be cutAsk anything"), green with it.app/tests/attachment-read-steps.test.tsx: three reads of one file draw as one row, "Read an attached file · survey-export.txt, in 3 parts", under "Read 1 file"; while a part is being read the line says "Reading an attached file…".app/tests/attachment-read-steps.test.tsx, "one read on a line of its own names the file it read": found in the end-to-end run below (the line read "Read an attached file" with a wrench and no file). Red before the fix (Received: "Read an attached file"), green after.End to end: Chrome and Safari
The real product on a throwaway box, with a stock Claude Agent SDK AG-UI agent (the AG-UI repository's own example, unmodified) on the real model, in Chromium and in WebKit. A person attaches a 500 KB
.txtand asks for its last line. Before is main; after is this branch.003629,pa, a line cut off at the 120,000th character.read_attachmentnear the end of the file, the step reads "Read an attached file · survey-export.txt", and it quotesTHE LAST LINE: survey closed with 412 parcelsexactly. The tile and the step use the existing components and tokens, and nothing else on either screen changed.Where it runs
deployment.deploymentanswer.API and database
docs/api-and-migrations.md. One new optional response field,attachmentsReadWholeondeployment. Nothing removed, renamed or tightened. No database change and norelease-policy.jsonchange.Changelog
API.
deploymenthas a new optionalattachmentsReadWhole: whether a Bot can read the whole of an attached text file or document, page by page, past the first 120,000 characters.Web app and OpenBot Desktop.